﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DiamondDesktop.Views;
using System.Windows.Controls;


namespace DiamondDesktop.Presenters
{
    public class ApplicationController
    {
        private  Window1 _shell;

        private static ApplicationController instance = null;

        public static ApplicationController getInstance() {
            if (instance == null)
                instance = new ApplicationController();
            return instance;
        }

        public void setShell(Window1 shell) {
            _shell = shell;
        }

        private ApplicationController()
        {
            
        }

        public void ShowNewtask()
        {
            new NewtaskPresenter(this);
        }

        public void ShowCount()
        {
            new CountPresenter(this);
        }

        public void ShowTaskList()
        {
            new TaskListPresenter(this);
        }

        public void ShowTaskGantt()
        {
            new TaskGanttPresenter(this);
        }


        public void ShowSetReminder()
        {
            new SetReminderPresenter(this);
        }

        public void ShowSetSystem()
        {
            new SetSystemPresenter(this);
        }


        public void DisplayInShell(object view)
        {
            //清理
            GC.Collect();
            GC.WaitForPendingFinalizers();

            _shell.TransitionTo(view);
        }



    }
}
